package com.xcy.quickhand.controller;

import com.alibaba.fastjson.JSON;
import com.xcy.quickhand.service.AuthorService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xcy
 * @version V1.0
 * @description
 * @date 2023/2/11 16:20
 */
@Slf4j
@RestController
@RequestMapping("author")
public class AuthorController {

    @Autowired
    private AuthorService authorService;

    @GetMapping("getList")
    public String getAuthorList() {

        System.out.println(JSON.toJSONString(authorService.getList()));
        return "m";
    }

    @GetMapping("getListTest")
    public String getListTest() throws InterruptedException {
        log.info("线程：{}", Thread.currentThread().getName());
        Thread.sleep(5000);
        return "success";
    }

}
